home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Graphics / Multimedia / Movie3.0 / Source / xanim / xanim_avi.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-02  |  6.5 KB  |  208 lines

  1.  
  2. /*
  3.  * xanim_avi.h
  4.  *
  5.  * Copyright (C) 1993,1994 by Mark Podlipec. 
  6.  * All rights reserved.
  7.  *
  8.  * This software may be freely copied, modified and redistributed without
  9.  * fee for non-commerical purposes provided that this copyright notice is
  10.  * preserved intact on all copies and modified copies.
  11.  * 
  12.  * There is no warranty or other guarantee of fitness of this software.
  13.  * It is provided solely "as is". The author(s) disclaim(s) all
  14.  * responsibility and liability with respect to this software's usage
  15.  * or its effect upon hardware or computer systems.
  16.  *
  17.  */
  18.  
  19. /* The following copyright applies to all Ultimotion segments of the code:
  20.  *
  21.  * "Copyright International Business Machines Corporation 1994, All rights
  22.  *  reserved. This product uses Ultimotion(tm) IBM video technology."
  23.  *
  24.  */
  25.  
  26.  
  27. #include "xanim.h"
  28.  
  29. #define RIFF_RIFF 0x52494646
  30. #define RIFF_LIST 0x4C495354
  31. #define RIFF_avih 0x61766968
  32. #define RIFF_strd 0x73747264
  33. #define RIFF_strh 0x73747268
  34. #define RIFF_strf 0x73747266
  35. #define RIFF_vedt 0x76656474
  36. #define RIFF_JUNK 0x4A554E4B
  37. #define RIFF_00pc 0x30307063
  38. #define RIFF_00dc 0x30306463
  39. #define RIFF_00dx 0x30306478
  40. #define RIFF_00db 0x30306462
  41. #define RIFF_00xx 0x30307878
  42. #define RIFF_00iv 0x30306976
  43. #define RIFF_00vc 0x30305643
  44. #define RIFF_01wb 0x30317762
  45. #define RIFF_idx1 0x69647831
  46. /*********VIDEO CODECS**************/
  47. #define RIFF_CRAM 0x4352414D
  48. #define RIFF_rgb  0x00000000
  49. #define RIFF_RGB  0x52474220
  50. #define RIFF_rle8 0x01000000
  51. #define RIFF_RLE8 0x524c4538
  52. #define RIFF_rle4 0x02000000
  53. #define RIFF_RLE4 0x524c4534
  54. #define RIFF_none 0x0000FFFF
  55. #define RIFF_NONE 0x4e4f4e45
  56. #define RIFF_pack 0x0100FFFF
  57. #define RIFF_PACK 0x5041434b
  58. #define RIFF_tran 0x0200FFFF
  59. #define RIFF_TRAN 0x5452414e
  60. #define RIFF_ccc  0x0300FFFF
  61. #define RIFF_CCC  0x43434320
  62. #define RIFF_jpeg 0x0400FFFF
  63. #define RIFF_JPEG 0x4A504547
  64. #define RIFF_rt21 0x72743231
  65. #define RIFF_RT21 0x52543231
  66. #define RIFF_IV31 0x49563331
  67. #define RIFF_CVID 0x63766964
  68. #define RIFF_ULTI 0x554c5449
  69.  
  70. #define RIFF_00AM 0x3030414d
  71. #define RIFF_AVI  0x41564920
  72. #define RIFF_hdrl 0x6864726C
  73. #define RIFF_strl 0x7374726C
  74. #define RIFF_DISP 0x44495350
  75. #define RIFF_ISBJ 0x4953424a
  76.  
  77. /* fcc Types */
  78. #define RIFF_vids 0x76696473
  79. #define RIFF_auds 0x61756473
  80.  
  81. /* fcc handlers */
  82. #define RIFF_RLE  0x524c4520
  83. #define RIFF_msvc 0x6D737663
  84. #define RIFF_MSVC 0x4d535643
  85.  
  86. typedef struct
  87. {
  88.   ULONG ckid;
  89.   ULONG flags;
  90.   ULONG chunk_offset;   /* position of chunk rel to movi list include 8b hdr*/
  91.   ULONG chunk_size;     /* length of chunk excluding 8 bytes for RIFF hdr */
  92. } AVI_INDEX_ENTRY;
  93.  
  94. /* Flags for AVI_INDEX_ENTRY */
  95. #define AVIIF_LIST          0x00000001L
  96. #define AVIIF_TWOCC         0x00000002L
  97.         /* keyframe doesn't need previous info to be decompressed */
  98. #define AVIIF_KEYFRAME      0x00000010L
  99.         /* this chunk needs the frames following it to be used */
  100. #define AVIIF_FIRSTPART     0x00000020L
  101.         /* this chunk needs the frames before it to be used */
  102. #define AVIIF_LASTPART      0x00000040L
  103. #define AVIIF_MIDPART       (AVIIF_LASTPART|AVIIF_FIRSTPART)
  104.         /* this chunk doesn't affect timing ie palette change */
  105. #define AVIIF_NOTIME        0x00000100L
  106. #define AVIIF_COMPUSE       0x0FFF0000L
  107.  
  108. typedef struct
  109. {
  110.   ULONG us_frame;       /* MicroSecPerFrame - timing between frames */
  111.   ULONG max_bps;        /* MaxBytesPerSec - approx bps system must handle */
  112.   ULONG pad_gran;       /* */
  113.   ULONG flags;          /* Flags */
  114.   ULONG tot_frames;     /* TotalFrames */
  115.   ULONG init_frames;    /* InitialFrames - initial frame before interleaving */
  116.   ULONG streams;        /* Streams */
  117.   ULONG sug_bsize;      /* SuggestedBufferSize */
  118.   ULONG width;          /* Width */
  119.   ULONG height;         /* Height */
  120.   ULONG scale;          /* Scale */
  121.   ULONG rate;           /* Rate */
  122.   ULONG start;          /* Start */
  123.   ULONG length;         /* Length */
  124. } AVI_HDR;
  125.  
  126. /* AVI_HDR Flags */
  127.         /* had idx1 chunk */
  128. #define AVIF_HASINDEX           0x00000010
  129.         /* must use idx1 chunk to determine order */
  130. #define AVIF_MUSTUSEINDEX       0x00000020
  131.         /* AVI file is interleaved */
  132. #define AVIF_ISINTERLEAVED      0x00000100
  133.         /* specially allocated used for capturing real time video */
  134. #define AVIF_WASCAPTUREFILE     0x00010000
  135.         /* contains copyrighted data */
  136. #define AVIF_COPYRIGHTED        0x00020000
  137.  
  138.  
  139. typedef struct
  140. {
  141.   ULONG fcc_type;       /* fccType  {vids} */
  142.   ULONG fcc_handler;    /* fccHandler {msvc,RLE} */
  143.   ULONG flags;          /* Flags */
  144.   ULONG priority;       /* Priority*/
  145.   ULONG init_frames;    /* InitialFrames */
  146.   ULONG scale;          /* Scale */
  147.   ULONG rate;           /* Rate */
  148.   ULONG start;          /* Start */
  149.   ULONG length;         /* Length In units above...*/
  150.   ULONG sug_bsize;      /* SuggestedBufferSize */
  151.   ULONG quality;        /* Quality */
  152.   ULONG samp_size;      /* SampleSize */
  153. } AVI_STREAM_HDR;
  154. /* AVI_STREAM_HDR Flags */
  155. #define AVISF_DISABLED                  0x00000001
  156. #define AVISF_VIDEO_PALCHANGES          0x00010000
  157.  
  158.  
  159. typedef struct /* BitMapInfoHeader */
  160. {
  161.   ULONG size;           /* Size */
  162.   ULONG width;          /* Width */
  163.   ULONG height;         /* Height */
  164.   ULONG planes;         /* short Planes */
  165.   ULONG bit_cnt;        /* short BitCount */
  166.   ULONG compression;    /* Compression {1} */
  167.   ULONG image_size;     /* SizeImage */
  168.   ULONG xpels_meter;    /* XPelsPerMeter */
  169.   ULONG ypels_meter;    /* XPelsPerMeter */
  170.   ULONG num_colors;     /* ClrUsed */
  171.   ULONG imp_colors;     /* ClrImportant */
  172. } VIDS_HDR;
  173.  
  174.  
  175. typedef struct AVI_FRAME_STRUCT
  176. {
  177.   ULONG time;
  178.   ULONG timelo;
  179.   XA_ACTION *act;
  180.   struct AVI_FRAME_STRUCT *next;
  181. } AVI_FRAME;
  182.  
  183. typedef struct /* BitMapInfoHeader */
  184. {
  185.   ULONG format;         /* S format */
  186.   ULONG channels;       /* S channels */
  187.   ULONG rate;           /* L rate */
  188.   ULONG av_bps;         /* L average bytes/sec */
  189.   ULONG align;          /* S alignment */
  190.   ULONG size;           /* S size */
  191.   ULONG style;          /* - SIGN2 or unsigned */
  192. } AUDS_HDR;
  193.  
  194. /**** from public Microsoft RIFF docs ******/
  195. #define WAVE_FORMAT_UNKNOWN             (0x0000)
  196. #define WAVE_FORMAT_PCM                 (0x0001)
  197. #define WAVE_FORMAT_ADPCM               (0x0002)
  198. #define WAVE_FORMAT_ALAW                (0x0006)
  199. #define WAVE_FORMAT_MULAW               (0x0007)
  200. #define WAVE_FORMAT_OKI_ADPCM           (0x0010)
  201. #define WAVE_FORMAT_DIGISTD             (0x0015)
  202. #define WAVE_FORMAT_DIGIFIX             (0x0016)
  203. #define IBM_FORMAT_MULAW                (0x0101)
  204. #define IBM_FORMAT_ALAW                 (0x0102)
  205. #define IBM_FORMAT_ADPCM                (0x0103)
  206. /*********************/
  207.  
  208.